This invention relates to time stamping of data packets output by a data source to a data acquisition system, and particularly but not solely to stamping of data packets output by a GPS receiver, such as UTC time or position measurements. Timing pulses output by the source are used to calculate a time of applicability for the information content of each packet.
Data acquisition typically involves production of data by one or more sources followed by various stages of processing, storage and use of the data. A source may be a specialized item of equipment which transmits a stream of data packets and associated timing signals for initial processing by an equipment handler which forms part of a separate computer system. One example of this arrangement is a navigational system in which one or more GPS (Global Positioning System) antenna/receivers produce time or position data for use by an onboard navigation system. A stream of relatively crude data is transmitted by each antenna/receiver over a cable connection for processing by a software package running on a central computer. Other arrangements may involve systems in which data originates from a software device or driver and is transmitted to another software device by way of inter-process communication channels, procedure calls or software queues.
Various methods are used by data acquisition system to calculate and stamp a time of applicability on packets in an incoming data stream. Once stamped the packed are passed on for further processing as required in the particular system. Methods involved constant latency determine a time of arrival for each packet in the system and simply subtract a fixed delay relating to the lapse of time between measurement of the data and the time arrival. More complex latency calculations involve variation of the delay according to the data itself, to account for water depth and speed of sound for example. In GPS related systems each data packet may already contain a GPS or UTC (Universal Time Coordinated) time stamp which may be converted to a local system time stamp, provided the difference between the two timeframes is known. The acquisition system will typically use GPS or UTC time inputs from a GPS receiver to calculate a running average time difference between the two timeframes, that is the GPS and UTC time from the receiver and the timeframe of the acquisition system. Data time of applicability can be calculated by subtracting an offset from each GPS or UTC time stamp.
Hardware timing is another common method for determining time of applicability. The stream of data packets is accompanied by a stream of timing pulses which are also output by the data source. Each packet transmitted from the source is assumed to be associated with a timing pulse which is expected to arrive before, after or during receipt of the packet according to a predetermined relationship. The time of applicability for the data in the packet is based on the time of arrival in the system of the corresponding pulse. One problem with a simple timing arrangement of this kind is that either a pulse or a packet may be missed, throwing the system out of synchronization. Various algorithms have been devised to solve the problem and reduce timing errors. For example, where a packet is received without a corresponding pulse, a time-out period may be permitted after which the packet is sent on with a time stamp based on the data packet time of arrival. Another solution involves statistical prediction of pulse arrival times and generation of proxy pulses.
A specific example of hardware timing occurs in the output of some GPS receivers. Trimble(trademark) 7400 receivers can produce ASCII time tag packets containing UTC data, at a rate of 1 Hz on a serial port. 1 PPS timing strobe can be output on an auxiliary port with the leading edge of each pulse coinciding with the beginning of UTC second. Time tags are output by about 0.5 s before their corresponding pulses. The receivers can also produce position packets near the beginning of each UTC second. However, experience has shown that pulses can be omitted from the timing stream for various reasons, and when the data stream is saturated relative to the serial port rate, the time tags can occasionally by missed as well.
It is therefore an object of the present invention to provide an improved or at least alternative method for time stamping in data acquisition systems which make use of hardware timing arrangements. The method has improved reliability in circumstances where pulses or packets are omitted from their respective timing or data streams.
Accordingly the invention may broadly be said to consist in a method of determining time stamps wherein the data acquisition system carries out an ongoing calculation of a xe2x80x9cnormalizedxe2x80x9d time of arrival for the timing pulses. A time of applicability for each data packet is then calculated from the normalized time of arrival without necessarily attributing any particular pulse to a particular data packet. In a preferred embodiment the normalization calculation involves averaging over a buffer of stored pulse times of arrival.
In one aspect the invention may also be said to consist in a method of determining time stamps for data packets arriving in a data acquisition system comprising: receiving a stream of timing pulses from a data source, determining a time of arrival for each received pulse, calculating a running normalized time of arrival for the pulses, receiving a stream of data packets from the data source, determining a time of arrival for each received data packet, and calculating a time stamp for each packet according to the time of arrival of the packet, the normalized time of arrival for the pulses, and a predetermined relationship between the packets and pulses.
In another aspect the invention may also be said to consist in a data acquisition apparatus comprising: a pulse time processing system for a receiving a stream of timing pulses from the source, a packet time processing system for receiving a stream of data packets from the source, wherein the pulse time processing system continually calculates a normalized pulse time of arrival as the pulses are received, and the packet time processing system calculates a time stamp for each received packet according to the normalized pulse time of arrival and a predetermined relationship between the packets and pulses.